package org.grow.pointcolor.widget;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.swing.*;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
@Component
public class ClearButton extends JButton implements MouseListener {
    @Autowired
    private JTextArea console;
    @PostConstruct
    private void springInit(){
        this.setText("清屏");
        setSize(20, 10);
        addMouseListener(this);
    }

    @Override
    public void mouseClicked(MouseEvent e) {
        console.setText("");
    }

    @Override
    public void mousePressed(MouseEvent e) {

    }

    @Override
    public void mouseReleased(MouseEvent e) {

    }

    @Override
    public void mouseEntered(MouseEvent e) {

    }

    @Override
    public void mouseExited(MouseEvent e) {

    }
}
